package com.zzyl.mapper;


import com.github.pagehelper.Page;
import com.zzyl.base.PageResponse;
import com.zzyl.dto.ReservationDto;
import com.zzyl.entity.Reservation;
import com.zzyl.vo.ReservationVo;
import com.zzyl.vo.TimeCountVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface CustomerReservationMapper {




    /**
     *1 查询取消预约数量
     * @param updateBy
     * @return
     */
    Integer countCancelledReservation(Long updateBy);


    /**
     *查询每个时间段剩余预约次数
     * @param
     * @param
     * @return
     */
    List<TimeCountVo> countReservationsForEachTime(@Param("start") LocalDateTime start, @Param("end") LocalDateTime end);


    /**
     * 新增
     * @param reservation
     */
    void add(Reservation reservation);


    /**
     * 分页查询
     * @param status
     * @return
     */
    Page<List<ReservationVo>> selectByPage(@Param("status") Integer status);


    /**
     * 取消预约
     * @param reservation
     */
    void cancelReservation(Reservation reservation);


    /**
     * 根据id查询预约
     * @param id
     * @return
     */
    Reservation selectById(Long id);
}
